package inventory.mappers;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import inventory.entity.MaterialTypical;
import inventory.entity.po.MaterialBrandAndModelPo;
import inventory.entity.po.TerminalAndEquipmentPo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sxt
 * @since 2019-11-06
 */
@Repository
public interface MaterialTypicalMapper extends BaseMapper<MaterialTypical> {


    /**
     * 查询大的类别下对应的所有的类别
     * @return
     */
    List<String> selectTypicalByCategoryId(@Param("id") String id,@Param("managerId") String managerId);




    /**
     * 根据TypicalName查询对应的所有的品牌及每个品牌的型号信息
     * @param name
     * @return
     */
    List<MaterialBrandAndModelPo> selectMaterialBrandAndModelPoByTypicalName(@Param("name") String name,@Param("managerId") String managerId,@Param("categoryId") String categoryId);


    /**
     * 根据TypicalId列表批量删除材料
     * @param typesId
     */
    void deleteMaterialByArray(@Param("typesId")List<String> typesId);

    /**
     * 根据终端或装备名称查询id，品牌，型号，单位，串号
     * @param typicalName
     * @return
     */
    List<TerminalAndEquipmentPo> selectTypicalByTypicalName(@Param("typicalName") String typicalName,@Param("managerId") String managerId);

    /**
     * 根据类型id列表，查询对应子目录下有没有记录
     * @param typesId
     * @return
     */
    List<MaterialTypical> selectListChildByTypesId(@Param("typesId")List<String> typesId);

    /**
     * 根据类型id，查询对应子目录下有没有记录
     * @param typicalId
     * @return
     */
    List<MaterialTypical> selectChildById(String typicalId);

    /**
     * 根据管理员id，查询管辖的材料种类
     * @param managerId
     * @return
     */
    List<MaterialTypical> selectByManagerId(String managerId);
}
